%YAP data for 2002 June 9-14 available at
%load('C:\Manoj\geomag\eclipse\6march2007.mat')
%got a request from ana tomas on 20-feb-08 (gmail)
%for yap data. replied on 22-feb (noaa mail)



clear yapdate yapdata bikdate bikdata;
s = dir('C:\Manoj\geomag\eclipse\yap\');

mjd_start = datenum(2000,1,1);
for i = 1:13,
[datax] = obs_read(['C:\Manoj\geomag\eclipse\yap\' s(i+2).name],'X');
[datay] = obs_read(['C:\Manoj\geomag\eclipse\yap\' s(i+2).name],'Y');
pp = 1;
for ii = 1:24,
    for  jj = 0:59,
        yapdate(i,pp) = datenum(datax(ii,1),datax(ii,2),datax(ii,3),datax(ii,4),jj,30)-mjd_start;
        pp = pp + 1;
    end;
end;
yapdata(i,:) = sqrt(reshape(datax(:,5:64)',[1,24*60]).^2+...
    reshape(datay(:,5:64)',[1,24*60]).^2);
end;


yapdata = yapdata*0.1;% 0.1nT is the calibration constant in the wdc file

yapdh = yapdata - repmat(mean(yapdata(:,800:900),2),[1,1440]);
yapdate1  = reshape(yapdate',[1,13*1440]);

%save c:\manoj\projects\eej\YAPMNBIK yapmnbik yapdate YAPMNBIK;

yapdhts = reshape(yapdh',[1,13*1440]);

fid = fopen('c:\manoj\geomag\eclipse\yap_june_2002.txt','wt')
for i = 1:length(yap_eclipse),
    fprintf(fid,'%d ', round(datevec(yap_eclipse_fday(i)+datenum(2000,1,1))));
    fprintf(fid,' %6.2f\n', yap_eclipse(i));
end;
fclose all;
    